The MetaCycle package is mainly used for detecting rhythmic signals from large scale time-series data. It incorporates ARSER(ARS), JTK_CYCLE(JTK), and Lomb-Scargle(LS) properly for periodic signal detection, and could also output integrated analysis results if required.
The usual time-series data is evenly sampled once at each time point, and the interval between neighbour time points is integer. Not all data are as simple as this. There are datasets with replicate samples, or with missing values, or un-evenly sampled, or sampled with a non-integer interval. Examples of these types of data are shown in the below table.
| Data Type | Point 1 | Point 2 | Point 3 | Point 4 | Point 5 | Point 6 |
|---|---|---|---|---|---|---|
| The usual data | CT0 | CT4 | CT8 | CT12 | CT16 | CT20 |
| With missing value | CT0 | NA | CT8 | CT12 | CT16 | CT20 |
| With replicates | CT0 | CT0 | CT8 | CT8 | CT16 | CT16 |
| With un-even interval | CT0 | CT2 | CT8 | CT10 | CT16 | CT20 |
| With non-integer interval | CT0 | CT4.5 | CT9 | CT13.5 | CT18 | CT22.5 |
Of course, some datasets may seem combination of two or more of above types of data.
| Data Type | Point 1 | Point 2 | Point 3 | Point 4 | Point 5 | Point 6 |
|---|---|---|---|---|---|---|
| With replicates and missing value | CT0 | CT0 | CT8 | NA | CT16 | CT16 |
| With un-even interval and replicates | CT0 | CT2 | CT2 | CT10 | CT16 | CT20 |
The meta2d function in MetaCycle is designed to analyze differnt types of time-series datasets, and it could automatically select proper method to analyze different types of input datasets. The implementation strategy used for meta2d is shown in the flow chart.
In addition to selecting proper methods to analyze different kinds of datasets, meta2d could also output integrated results from multiple methods. Detail explaination about integration stragegies is in the vignettes of MetaCycle.
meta2d recalculates the amplitude with following model: \[Y_i = B + TRE*(t_i - \frac{\sum_{i=1}^n t_i}{n}) + A*cos(2*\pi*\frac{t_i - PHA}{PER})\]
The baseline and trend level are explained in the below example.
| Column name | Description | Column name | Description |
|---|---|---|---|
| ARS_pvalue | pvalue from ARS | LS_BH.Q | FDR from LS |
| ARS_BH.Q | FDR from ARS | LS_period | period from LS |
| ARS_period | period from ARS | LS_adjphase | adjusted phase from LS |
| ARS_adjphase | adjusted phase from ARS | LS_amplitude | amplitude from LS |
| ARS_amplitude | amplitude from ARS | meta2d_pvalue | integrated pvalue |
| JTK_pvalue | pvalue from JTK | meta2d_BH.Q | FDR based on integrated pvalue |
| JTK_BH.Q | FDR from JTK | meta2d_period | averaged period |
| JTK_period | period from JTK | meta2d_phase | integrated phase |
| JTK_adjphase | adjusted phase from JTK | meta2d_Base | baseline value given by meta2d |
| JTK_amplitude | amplitude from JTK | meta2d_AMP | amplitude given by meta2d |
| LS_pvalue | pvalue from LS | meta2d_rAMP | relative amplitude |
# load 'shiny' package
library("shiny")
# load 'MetaCycle' package
library("MetaCycle")
# load 'dplyr' package
library("dplyr")
# load 'ggplot2' package
library("ggplot2")
# load 'cowplot' package
library("cowplot")
# change working directory to the desktop
setwd("~/Desktop")
# check required directories under the desktop
dir()
# load shiny package
library("shiny")
# use 'runGitHub' function of shiny package
runGitHub("MetaCycleApp", "gangwug")
# load shiny package
library("shiny")
# use 'runApp' function of shiny package
runApp("~/Desktop/MetaCycleApp-master")
experimentA: 1) evenly sampled with 2h interval covering two days (from CT18 to CT64), 2) no replicate or missing value, 3) sampling time information is numeric value in the header, 4) including 10K probesets (about 1/4 of total probesets for MOE4302 array)